home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / schedctl.z / schedctl
Encoding:
Text File  |  2002-10-03  |  13.1 KB  |  264 lines

  1.  
  2.  
  3.  
  4. sssscccchhhheeeeddddccccttttllll((((2222))))                                                        sssscccchhhheeeeddddccccttttllll((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_cccc_hhhh_eeee_dddd_cccc_tttt_llll - scheduler control call
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<lllliiiimmmmiiiittttssss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////pppprrrrccccttttllll....hhhh>>>>
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////sssscccchhhheeeeddddccccttttllll....hhhh>>>>
  16.      iiiinnnntttt sssscccchhhheeeeddddccccttttllll ((((iiiinnnntttt ccccmmmmdddd,,,, [[[[ iiiinnnntttt aaaarrrrgggg1111 [[[[ ,,,, iiiinnnntttt aaaarrrrgggg2222 ]]]] ]]]]))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      This system call is used to alter scheduling parameters of either
  20.      individual processes or of the system as a whole.  The following commands
  21.      are supported:
  22.  
  23.      AAAAFFFFFFFFIIIINNNNIIIITTTTYYYY____OOOONNNN
  24.              This command enables cache affinity for the calling or another
  25.              process.  _a_r_g_1 is the process ID of the process to be modified;
  26.              if zero, it indicates the current process.  The affinity status
  27.              is inherited by the process's children after a fork.  By default,
  28.              affinity is on.
  29.  
  30.      AAAAFFFFFFFFIIIINNNNIIIITTTTYYYY____OOOOFFFFFFFF
  31.              This command disables cache affinity for the calling or another
  32.              process.  _a_r_g_1 is the process ID of the process to be modified;
  33.              if zero, it indicates the current process.  The affinity status
  34.              is inherited by the process's children after a fork.
  35.  
  36.      AAAAFFFFFFFFIIIINNNNIIIITTTTYYYY____SSSSTTTTAAAATTTTUUUUSSSS
  37.              This command returns the current cache affinity status for the
  38.              calling or another process.  _a_r_g_1 is the process ID of the
  39.              process to be modified; if zero, it indicates the current
  40.              process.  If affinity is on, it returns 0, otherwise 1.
  41.  
  42.      RRRREEEENNNNIIIICCCCEEEE  This command allows a process to change its own or another
  43.              process's _n_i_c_e value.  _a_r_g_1 is the process ID of the process to
  44.              be modified; if zero, it indicates the current process.  _a_r_g_2 is
  45.              the new process nice value to use.  This is different than the
  46.              value given to the _n_i_c_e(2) system call.  _n_i_c_e takes a relative
  47.              value, while this command changes the absolute nice value of the
  48.              process which ranges from 0 to 39.  The default absolute nice
  49.              value for a process is 20.
  50.  
  51.              The process must have superuser permissions to use this command.
  52.              The previous (absolute) nice value is returned.
  53.  
  54.      SSSSLLLLIIIICCCCEEEE   This command allows a process to change its own or another
  55.              process's time slice.  A time slice is the period of time that a
  56.              process is allowed to run before being eligible for preemption by
  57.              another process.  _a_r_g_1 is the process ID of the process to be
  58.              altered; if zero, it indicates the current process.  _a_r_g_2 is the
  59.              new time slice value to use, expressed in terms of _c_l_o_c_k _t_i_c_k_s.
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. sssscccchhhheeeeddddccccttttllll((((2222))))                                                        sssscccchhhheeeeddddccccttttllll((((2222))))
  70.  
  71.  
  72.  
  73.              The system software clock fires CCCCLLLLKKKK____TTTTCCCCKKKK times per second; hence
  74.              the duration of a clock tick in milliseconds is equal to
  75.              1111000000000000////CCCCLLLLKKKK____TTTTCCCCKKKK (see <_l_i_m_i_t_s._h>).  _a_r_g_2 is constrained to be greater
  76.              than 0, and less than 10 seconds.
  77.  
  78.              The process must have superuser permissions to use this command.
  79.              The previous time slice value is returned.
  80.  
  81.      SSSSEEEETTTTHHHHIIIINNNNTTTTSSSS
  82.              This command sets up a communication path between the process and
  83.              the kernel, which allows the process to communicate scheduling
  84.              modes to the kernel without the overhead of a system call.  The
  85.              return value is a pointer to a _p_r_d_a__s_y_s structure, defined in
  86.              <_s_y_s/_p_r_c_t_l._h>.  Since the return value for _ssss_cccc_hhhh_eeee_dddd_cccc_tttt_llll is defined as
  87.              an integer, it is necessary to cast this value to a ssssttttrrrruuuucccctttt
  88.              pppprrrrddddaaaa____ssssyyyyssss **** before using it.  Also, since the optimizer can remove
  89.              references to variables which have no apparent uses, it is best
  90.              to declare the variable with the _v_o_l_a_t_i_l_e attribute:
  91.  
  92.              vvvvoooollllaaaattttiiiilllleeee ssssttttrrrruuuucccctttt pppprrrrddddaaaa____ssssyyyyssss ****pppprrrrddddaaaa____ssssyyyyssss;;;;
  93.  
  94.              After a SSSSEEEETTTTHHHHIIIINNNNTTTTSSSS command, the process may write scheduling modes
  95.              to the _t__h_i_n_t field of the _p_r_d_a__s_y_s structure.  These scheduling
  96.              modes will be observed by the kernel at process dispatch time.
  97.              The scheduling modes are the same as those defined for the
  98.              SSSSCCCCHHHHEEEEDDDDMMMMOOOODDDDEEEE command.
  99.  
  100.              Also, the _t__c_p_u field may be read by user code to obtain the
  101.              identifier of the cpu where the process was recently scheduled.
  102.  
  103.      The next two commands provide control over the scheduling of groups of
  104.      parallel processes on multi-cpu systems.  The processes must be members
  105.      of the same _s_h_a_r_egroup (see _s_p_r_o_c(2) for more information about share
  106.      groups).  Note that the SSSSCCCCHHHHEEEEDDDDMMMMOOOODDDDEEEE and SSSSEEEETTTTMMMMAAAASSSSTTTTEEEERRRR commands can only be used
  107.      after a share group has been created.
  108.  
  109.      SSSSCCCCHHHHEEEEDDDDMMMMOOOODDDDEEEE
  110.              This command allows a member of a share group to set a _s_c_h_e_d_u_l_i_n_g
  111.              _m_o_d_e for the entire share group.  _a_r_g_1 specifies the scheduling
  112.              mode.  These are SSSSGGGGSSSS____FFFFRRRREEEEEEEE, which specifies that each member of
  113.              the share group is to be scheduled independently, SSSSGGGGSSSS____SSSSIIIINNNNGGGGLLLLEEEE,
  114.              which specifies that only the _m_a_s_t_e_r is to run (see SSSSEEEETTTTMMMMAAAASSSSTTTTEEEERRRR for
  115.              setting the master thread), and SSSSGGGGSSSS____GGGGAAAANNNNGGGG, which specifies that
  116.              all members of the share group are to be scheduled as a unit, if
  117.              possible.  The default scheduling mode when a share group is
  118.              created is SSSSGGGGSSSS____FFFFRRRREEEEEEEE.
  119.  
  120.              The previous scheduling mode is returned.
  121.  
  122.      SSSSEEEETTTTMMMMAAAASSSSTTTTEEEERRRR
  123.              This command sets the _m_a_s_t_e_r _p_r_o_c_e_s_s of the share group.  _a_r_g_1
  124.              specifies the _p_i_d of the new master process.
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. sssscccchhhheeeeddddccccttttllll((((2222))))                                                        sssscccchhhheeeeddddccccttttllll((((2222))))
  136.  
  137.  
  138.  
  139.              By default, the creator of the share group is the master process.
  140.              The master process differs from other members of the share group
  141.              only in the case of the SSSSGGGGSSSS____SSSSIIIINNNNGGGGLLLLEEEE scheduling mode.  In that
  142.              case, only the master process will run.  This operation can only
  143.              be performed by the master of the share group.  On success, 0 is
  144.              returned.
  145.  
  146.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____CCCCRRRREEEEAAAATTTTEEEE
  147.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____DDDDEEEEQQQQUUUUEEEEUUUUEEEE
  148.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____DDDDEEEESSSSTTTTRRRROOOOYYYY
  149.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____EEEENNNNQQQQUUUUEEEEUUUUEEEE
  150.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____GGGGEEEETTTTAAAATTTTTTTTRRRR
  151.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____GGGGEEEETTTTQQQQUUUUEEEEUUUUEEEELLLLEEEENNNN
  152.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____IIIINNNNTTTTRRRR
  153.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____JJJJOOOOIIIINNNN
  154.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____PPPPIIIINNNNSSSSEEEERRRRTTTT
  155.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____PPPPRRRREEEEMMMMOOOOVVVVEEEE
  156.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____RRRREEEEAAAADDDDQQQQUUUUEEEEUUUUEEEE
  157.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____RRRREEEESSSSUUUUMMMMEEEE
  158.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____SSSSEEEETTTTAAAATTTTTTTTRRRR
  159.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____SSSSTTTTAAAARRRRTTTT
  160.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____SSSSTTTTOOOOPPPP
  161.      MMMMPPPPTTTTSSSS____FFFFRRRRSSSS____YYYYIIIIEEEELLLLDDDD
  162.                  These are all interfaces that are used to implement various
  163.                  _f_r_s functions.  These are all subject to change and should
  164.                  not be called directly by applications.
  165.  
  166.      <_s_y_s/_s_c_h_e_d_c_t_l._h>.
  167.  
  168.      _s_c_h_e_d_c_t_l will fail if any of the following are true:
  169.  
  170.      [EINVAL]    An invalid command or new value was passed to the system.
  171.  
  172.      [EINVAL]    The command was SSSSCCCCHHHHEEEEDDDDMMMMOOOODDDDEEEE, and either the process was not a
  173.                  member of a share group, or _a_r_g_1 did not specify a valid
  174.                  scheduling mode.
  175.  
  176.      [EINVAL]    The command was SSSSEEEETTTTMMMMAAAASSSSTTTTEEEERRRR, and either the process was not a
  177.                  member of a share group, the process was not the current
  178.                  master of the share group, or _a_r_g_1 specified a process that
  179.                  was not a member of the share group.
  180.  
  181.      [EPERM]     An attempt was made to perform privileged operations without
  182.                  appropriate permissions.
  183.  
  184.      [ESRCH]     The named process was not found.
  185.  
  186. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  187.      npri(1), nice(2), prctl(2), sched_getparam(2), sched_setparam(2),
  188.      sched_getscheduler(2), sched_yield(2), sched_get_priority_max(2),
  189.      sched_get_priority_min(2), sched_rr_get_interval(2), sproc(2), sysmp(2)
  190.  
  191.  
  192.  
  193.  
  194.                                                                         PPPPaaaaggggeeee 3333
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. sssscccchhhheeeeddddccccttttllll((((2222))))                                                        sssscccchhhheeeeddddccccttttllll((((2222))))
  202.  
  203.  
  204.  
  205. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  206.      _s_c_h_e_d_c_t_l returns -1 if an error occurred.  Otherwise, the return is
  207.      dependent on _c_m_d.
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                                                                         PPPPaaaaggggeeee 4444
  261.  
  262.  
  263.  
  264.